import java.util.ArrayList;
import java.util.Collections;
import java.util.stream.Stream;

public class h_2 {
    public static void main(String[] args) {
        ArrayList<String> man=new ArrayList<>();
        ArrayList<String> woman=new ArrayList<>();
        Collections.addAll(man,"薛之谦","周杰伦","陈奕迅","汪峰","王力宏","汪东城");
        Collections.addAll(woman,"杨幂","迪丽热巴","古力娜扎","林青霞","邓紫棋","杨颖");
        ArrayList<String> people=new ArrayList<>();
//        for(int i=0;i<man.size();i++){
//            if(man.get(i).length()==3 && people.size()<3){
//                people.add(man.get(i));
//            }
//        }
        Stream<String> mans = man.stream().filter(s -> s.length() == 3).limit(3);
        Stream<String> womans = woman.stream().skip(1).filter(s -> s.charAt(0) == '林');
        Stream.concat(mans,womans).forEach(s-> System.out.println(s));
//        for(int i=0;i<woman.size();i++){
//            if(woman.get(i).charAt(0)=='林' && i!=0){
//                people.add(woman.get(i));
//            }
//        }
//        System.out.println(people);

    }
}
